<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>返回两个⽇期之间相差的天数</title>
</head>
<body>
    
</body>
</html>
<script>
    var date1 = new Date('2022-10-24');
	var date2 = new Date('2022-11-04');
	var num1 = date1.getTime();
	var num2 = date2.getTime();
	var res = num2 - num1;
	res = res/24/60/60/1000;
	console.log(res);
</script>